bitkeeper revision 1.22.2.10 (3e464021ENDSDzm_b9aKHVld8d-Hqw)
authorkaf24@labyrinth.cl.cam.ac.uk <kaf24@labyrinth.cl.cam.ac.uk>
Sun, 9 Feb 2003 11:48:49 +0000 (11:48 +0000)
committerkaf24@labyrinth.cl.cam.ac.uk <kaf24@labyrinth.cl.cam.ac.uk>
Sun, 9 Feb 2003 11:48:49 +0000 (11:48 +0000)
if_vlan.h, tg3.c, e1000_main.c, apic.c:
  Minor cleanups.

xen-2.4.16/arch/i386/apic.c
xen-2.4.16/drivers/net/e1000/e1000_main.c
xen-2.4.16/drivers/net/tg3.c
xen-2.4.16/include/xeno/if_vlan.h

index 8cfe52e5d3fc1a738795dc9b25987a46b9aefa49..10b9ef03ffd8792fec3ec14dbea32f98e0abfe35 100644 (file)
@@ -200,35 +200,16 @@ void __init sync_Arb_IDs(void)
 extern void __error_in_apic_c (void);
 
 /*
- * An initial setup of the virtual wire mode.
+ * WAS: An initial setup of the virtual wire mode.
+ * NOW: We don't bother doing anything. All we need at this point
+ * is to receive timer ticks, so that 'jiffies' is incremented.
+ * If we're SMP, then we can assume BIOS did setup for us.
+ * If we're UP, then the APIC should be disabled (it is at reset).
+ * If we're UP and APIC is enabled, then BIOS is clever and has 
+ * probably done initial interrupt routing for us.
  */
 void __init init_bsp_APIC(void)
 {
-    unsigned long l, h;
-
-    /*
-     * Don't do the setup now if we have a SMP BIOS as the
-     * through-I/O-APIC virtual wire mode might be active.
-     */
-    if (smp_found_config || !cpu_has_apic)
-        return;
-
-    /*
-     * Our best bet here is to disable the APIC. This should be safe, as it
-     * ought to be a uniprocessor box (we tested for an SMP configuration
-     * already), so we shouldn't be getting interrupt messages in serial-bus
-     * form from an IO APIC. The APIC will be enabled again later, so don't
-     * worry :-) Doing the easy thing here should make boot-time more reliable.
-     */
-    printk("Disabling local APIC during early boot sequence...\n");
-    rdmsr(MSR_IA32_APICBASE, l, h);
-    l &= ~MSR_IA32_APICBASE_BASE;
-    wrmsr(MSR_IA32_APICBASE, l, h);
-
-    /* We should now be in non-APIC mode. */
-    l = cpuid_edx(1);
-    if ( test_bit(X86_FEATURE_APIC, &l) ) BUG();
-    clear_bit(X86_FEATURE_APIC, &boot_cpu_data.x86_capability);
 }
 
 void __init setup_local_APIC (void)
index 3d4556b68e1508fee506ef7a394984e3dc3bb68e..0d3b62505aa318825136932a22d70e9ddb8517ce 100644 (file)
@@ -210,10 +210,13 @@ static int __init
 e1000_init_module(void)
 {
        int ret;
+
+#if 0 /* Avoid disconcerting noise. */
        printk(KERN_INFO "%s - version %s\n",
               e1000_driver_string, e1000_driver_version);
 
        printk(KERN_INFO "%s\n", e1000_copyright);
+#endif
 
        ret = pci_module_init(&e1000_driver);
 //     if(ret >= 0)
@@ -1470,7 +1473,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 static void
 e1000_tx_timeout(struct net_device *netdev)
 {
-       struct e1000_adapter *adapter = netdev->priv;
+    //struct e1000_adapter *adapter = netdev->priv;
 
        /* Do the reset outside of interrupt context */
        //schedule_task(&adapter->tx_timeout_task); XXXX Not in Xen!!!
index 2f36ffbca45c63a0a01170fe865e614dca3418fc..060154fa2b496afbc347b15e256ae0d5ed1d1ee2 100644 (file)
@@ -2000,9 +2000,9 @@ static int tg3_poll(struct net_device *netdev, int *budget)
 {
        struct tg3 *tp = netdev->priv;
        struct tg3_hw_status *sblk = tp->hw_status;
-       unsigned long flags;
        int done;
 #ifdef NAPI
+       unsigned long flags;
        spin_lock_irqsave(&tp->lock, flags);
 #endif
        if (!(tp->tg3_flags &
@@ -2023,10 +2023,9 @@ static int tg3_poll(struct net_device *netdev, int *budget)
 
        done = 1;
        if (sblk->idx[0].rx_producer != tp->rx_rcb_ptr) {
-               int orig_budget = *budget;
                int work_done;
-
 #ifdef NAPI
+               int orig_budget = *budget;
                if (orig_budget > netdev->quota)
                        orig_budget = netdev->quota;
 
@@ -2075,7 +2074,9 @@ static void tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
        struct net_device *dev = dev_id;
        struct tg3 *tp = dev->priv;
+#ifdef NAPI
        struct tg3_hw_status *sblk = tp->hw_status;
+#endif
        unsigned long flags;
 
        spin_lock_irqsave(&tp->lock, flags);
index aa9fb4989021aa445b5c1b70e4e8c3a129b9b5ae..c8c0903e521a246b8efb98bc8edef524f7b86b26 100644 (file)
@@ -183,7 +183,11 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
                break;
        };
 
+#ifdef NAPI
        return (polling ? netif_receive_skb(skb) : netif_rx(skb));
+#else
+        return netif_rx(skb);
+#endif
 }
 
 static inline int vlan_hwaccel_rx(struct sk_buff *skb,